﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;

namespace Sensors
{
    class InterfaceSensor
    {
        public void run()
        {
            if (NetworkInterface.GetIsNetworkAvailable())
            {
                NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
                foreach (NetworkInterface ni in interfaces)
                {
                    Console.WriteLine("Interface Name : {0}", ni.Name.ToString());
                    Console.WriteLine(ni.Id);
                }
            }
            else
            {
                Console.WriteLine("None Available");
            }
            //IPAddress i = IPAddress.Broadcast;
            //Console.WriteLine(i.ToString());
        }
    }
}
